3.12.48 \(\int \frac {(A+B x) (d+e x)^2}{(b x+c x^2)^2} \, dx\) [1148]

Optimal. Leaf size=108 \[ -\frac {A d^2}{b^2 x}+\frac {(b B-A c) (c d-b e)^2}{b^2 c^2 (b+c x)}+\frac {d (b B d-2 A c d+2 A b e) \log (x)}{b^3}-\frac {(c d-b e) \left (b B c d-2 A c^2 d+b^2 B e\right ) \log (b+c x)}{b^3 c^2} \]

[Out]

-A*d^2/b^2/x+(-A*c+B*b)*(-b*e+c*d)^2/b^2/c^2/(c*x+b)+d*(2*A*b*e-2*A*c*d+B*b*d)*ln(x)/b^3-(-b*e+c*d)*(-2*A*c^2*
d+B*b^2*e+B*b*c*d)*ln(c*x+b)/b^3/c^2

________________________________________________________________________________________

Rubi [A]
time = 0.08, antiderivative size = 108, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.042, Rules used = {785} \begin {gather*} \frac {d \log (x) (2 A b e-2 A c d+b B d)}{b^3}+\frac {(b B-A c) (c d-b e)^2}{b^2 c^2 (b+c x)}-\frac {A d^2}{b^2 x}-\frac {(c d-b e) \log (b+c x) \left (-2 A c^2 d+b^2 B e+b B c d\right )}{b^3 c^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((A + B*x)*(d + e*x)^2)/(b*x + c*x^2)^2,x]

[Out]

-((A*d^2)/(b^2*x)) + ((b*B - A*c)*(c*d - b*e)^2)/(b^2*c^2*(b + c*x)) + (d*(b*B*d - 2*A*c*d + 2*A*b*e)*Log[x])/
b^3 - ((c*d - b*e)*(b*B*c*d - 2*A*c^2*d + b^2*B*e)*Log[b + c*x])/(b^3*c^2)

Rule 785

Int[((d_.) + (e_.)*(x_))^(m_.)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> In
t[ExpandIntegrand[(d + e*x)^m*(f + g*x)*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g, m}, x] && N
eQ[b^2 - 4*a*c, 0] && IntegerQ[p] && (GtQ[p, 0] || (EqQ[a, 0] && IntegerQ[m]))

Rubi steps

\begin {align*} \int \frac {(A+B x) (d+e x)^2}{\left (b x+c x^2\right )^2} \, dx &=\int \left (\frac {A d^2}{b^2 x^2}+\frac {d (b B d-2 A c d+2 A b e)}{b^3 x}-\frac {(b B-A c) (-c d+b e)^2}{b^2 c (b+c x)^2}+\frac {(-c d+b e) \left (b B c d-2 A c^2 d+b^2 B e\right )}{b^3 c (b+c x)}\right ) \, dx\\ &=-\frac {A d^2}{b^2 x}+\frac {(b B-A c) (c d-b e)^2}{b^2 c^2 (b+c x)}+\frac {d (b B d-2 A c d+2 A b e) \log (x)}{b^3}-\frac {(c d-b e) \left (b B c d-2 A c^2 d+b^2 B e\right ) \log (b+c x)}{b^3 c^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.08, size = 101, normalized size = 0.94 \begin {gather*} \frac {-\frac {A b d^2}{x}+\frac {b (b B-A c) (c d-b e)^2}{c^2 (b+c x)}+d (b B d-2 A c d+2 A b e) \log (x)+\frac {(-c d+b e) \left (b B c d-2 A c^2 d+b^2 B e\right ) \log (b+c x)}{c^2}}{b^3} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((A + B*x)*(d + e*x)^2)/(b*x + c*x^2)^2,x]

[Out]

(-((A*b*d^2)/x) + (b*(b*B - A*c)*(c*d - b*e)^2)/(c^2*(b + c*x)) + d*(b*B*d - 2*A*c*d + 2*A*b*e)*Log[x] + ((-(c
*d) + b*e)*(b*B*c*d - 2*A*c^2*d + b^2*B*e)*Log[b + c*x])/c^2)/b^3

________________________________________________________________________________________

Maple [A]
time = 0.61, size = 156, normalized size = 1.44

method result size
default \(\frac {\left (-2 A b \,c^{2} d e +2 A \,c^{3} d^{2}+b^{3} B \,e^{2}-B b \,c^{2} d^{2}\right ) \ln \left (c x +b \right )}{b^{3} c^{2}}-\frac {A \,b^{2} c \,e^{2}-2 A b \,c^{2} d e +A \,c^{3} d^{2}-b^{3} B \,e^{2}+2 B \,b^{2} c d e -B b \,c^{2} d^{2}}{c^{2} b^{2} \left (c x +b \right )}-\frac {A \,d^{2}}{b^{2} x}+\frac {d \left (2 A b e -2 A c d +B b d \right ) \ln \left (x \right )}{b^{3}}\) \(156\)
norman \(\frac {\frac {\left (A \,b^{2} c \,e^{2}-2 A b \,c^{2} d e +2 A \,c^{3} d^{2}-b^{3} B \,e^{2}+2 B \,b^{2} c d e -B b \,c^{2} d^{2}\right ) x^{2}}{b^{3} c}-\frac {A \,d^{2}}{b}}{x \left (c x +b \right )}+\frac {d \left (2 A b e -2 A c d +B b d \right ) \ln \left (x \right )}{b^{3}}-\frac {\left (2 A b \,c^{2} d e -2 A \,c^{3} d^{2}-b^{3} B \,e^{2}+B b \,c^{2} d^{2}\right ) \ln \left (c x +b \right )}{b^{3} c^{2}}\) \(162\)
risch \(\frac {-\frac {\left (A \,b^{2} c \,e^{2}-2 A b \,c^{2} d e +2 A \,c^{3} d^{2}-b^{3} B \,e^{2}+2 B \,b^{2} c d e -B b \,c^{2} d^{2}\right ) x}{b^{2} c^{2}}-\frac {A \,d^{2}}{b}}{x \left (c x +b \right )}-\frac {2 \ln \left (c x +b \right ) A d e}{b^{2}}+\frac {2 c \ln \left (c x +b \right ) A \,d^{2}}{b^{3}}+\frac {\ln \left (c x +b \right ) B \,e^{2}}{c^{2}}-\frac {\ln \left (c x +b \right ) B \,d^{2}}{b^{2}}+\frac {2 d \ln \left (-x \right ) A e}{b^{2}}-\frac {2 d^{2} \ln \left (-x \right ) A c}{b^{3}}+\frac {d^{2} \ln \left (-x \right ) B}{b^{2}}\) \(185\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((B*x+A)*(e*x+d)^2/(c*x^2+b*x)^2,x,method=_RETURNVERBOSE)

[Out]

1/b^3*(-2*A*b*c^2*d*e+2*A*c^3*d^2+B*b^3*e^2-B*b*c^2*d^2)/c^2*ln(c*x+b)-(A*b^2*c*e^2-2*A*b*c^2*d*e+A*c^3*d^2-B*
b^3*e^2+2*B*b^2*c*d*e-B*b*c^2*d^2)/c^2/b^2/(c*x+b)-A*d^2/b^2/x+d*(2*A*b*e-2*A*c*d+B*b*d)*ln(x)/b^3

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 168, normalized size = 1.56 \begin {gather*} -\frac {A b c^{2} d^{2} - {\left (B b^{3} e^{2} - A b^{2} c e^{2} + {\left (B b c^{2} - 2 \, A c^{3}\right )} d^{2} - 2 \, {\left (B b^{2} c e - A b c^{2} e\right )} d\right )} x}{b^{2} c^{3} x^{2} + b^{3} c^{2} x} + \frac {{\left (2 \, A b d e + {\left (B b - 2 \, A c\right )} d^{2}\right )} \log \left (x\right )}{b^{3}} - \frac {{\left (2 \, A b c^{2} d e - B b^{3} e^{2} + {\left (B b c^{2} - 2 \, A c^{3}\right )} d^{2}\right )} \log \left (c x + b\right )}{b^{3} c^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(e*x+d)^2/(c*x^2+b*x)^2,x, algorithm="maxima")

[Out]

-(A*b*c^2*d^2 - (B*b^3*e^2 - A*b^2*c*e^2 + (B*b*c^2 - 2*A*c^3)*d^2 - 2*(B*b^2*c*e - A*b*c^2*e)*d)*x)/(b^2*c^3*
x^2 + b^3*c^2*x) + (2*A*b*d*e + (B*b - 2*A*c)*d^2)*log(x)/b^3 - (2*A*b*c^2*d*e - B*b^3*e^2 + (B*b*c^2 - 2*A*c^
3)*d^2)*log(c*x + b)/(b^3*c^2)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 262 vs. \(2 (112) = 224\).
time = 3.04, size = 262, normalized size = 2.43 \begin {gather*} -\frac {A b^{2} c^{2} d^{2} - {\left (B b^{2} c^{2} - 2 \, A b c^{3}\right )} d^{2} x + 2 \, {\left (B b^{3} c - A b^{2} c^{2}\right )} d x e - {\left (B b^{4} - A b^{3} c\right )} x e^{2} + {\left ({\left (B b c^{3} - 2 \, A c^{4}\right )} d^{2} x^{2} + {\left (B b^{2} c^{2} - 2 \, A b c^{3}\right )} d^{2} x - {\left (B b^{3} c x^{2} + B b^{4} x\right )} e^{2} + 2 \, {\left (A b c^{3} d x^{2} + A b^{2} c^{2} d x\right )} e\right )} \log \left (c x + b\right ) - {\left ({\left (B b c^{3} - 2 \, A c^{4}\right )} d^{2} x^{2} + {\left (B b^{2} c^{2} - 2 \, A b c^{3}\right )} d^{2} x + 2 \, {\left (A b c^{3} d x^{2} + A b^{2} c^{2} d x\right )} e\right )} \log \left (x\right )}{b^{3} c^{3} x^{2} + b^{4} c^{2} x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(e*x+d)^2/(c*x^2+b*x)^2,x, algorithm="fricas")

[Out]

-(A*b^2*c^2*d^2 - (B*b^2*c^2 - 2*A*b*c^3)*d^2*x + 2*(B*b^3*c - A*b^2*c^2)*d*x*e - (B*b^4 - A*b^3*c)*x*e^2 + ((
B*b*c^3 - 2*A*c^4)*d^2*x^2 + (B*b^2*c^2 - 2*A*b*c^3)*d^2*x - (B*b^3*c*x^2 + B*b^4*x)*e^2 + 2*(A*b*c^3*d*x^2 +
A*b^2*c^2*d*x)*e)*log(c*x + b) - ((B*b*c^3 - 2*A*c^4)*d^2*x^2 + (B*b^2*c^2 - 2*A*b*c^3)*d^2*x + 2*(A*b*c^3*d*x
^2 + A*b^2*c^2*d*x)*e)*log(x))/(b^3*c^3*x^2 + b^4*c^2*x)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 367 vs. \(2 (105) = 210\).
time = 2.20, size = 367, normalized size = 3.40 \begin {gather*} \frac {- A b c^{2} d^{2} + x \left (- A b^{2} c e^{2} + 2 A b c^{2} d e - 2 A c^{3} d^{2} + B b^{3} e^{2} - 2 B b^{2} c d e + B b c^{2} d^{2}\right )}{b^{3} c^{2} x + b^{2} c^{3} x^{2}} + \frac {d \left (2 A b e - 2 A c d + B b d\right ) \log {\left (x + \frac {- 2 A b^{2} c d e + 2 A b c^{2} d^{2} - B b^{2} c d^{2} + b c d \left (2 A b e - 2 A c d + B b d\right )}{- 4 A b c^{2} d e + 4 A c^{3} d^{2} + B b^{3} e^{2} - 2 B b c^{2} d^{2}} \right )}}{b^{3}} + \frac {\left (b e - c d\right ) \left (- 2 A c^{2} d + B b^{2} e + B b c d\right ) \log {\left (x + \frac {- 2 A b^{2} c d e + 2 A b c^{2} d^{2} - B b^{2} c d^{2} + \frac {b \left (b e - c d\right ) \left (- 2 A c^{2} d + B b^{2} e + B b c d\right )}{c}}{- 4 A b c^{2} d e + 4 A c^{3} d^{2} + B b^{3} e^{2} - 2 B b c^{2} d^{2}} \right )}}{b^{3} c^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(e*x+d)**2/(c*x**2+b*x)**2,x)

[Out]

(-A*b*c**2*d**2 + x*(-A*b**2*c*e**2 + 2*A*b*c**2*d*e - 2*A*c**3*d**2 + B*b**3*e**2 - 2*B*b**2*c*d*e + B*b*c**2
*d**2))/(b**3*c**2*x + b**2*c**3*x**2) + d*(2*A*b*e - 2*A*c*d + B*b*d)*log(x + (-2*A*b**2*c*d*e + 2*A*b*c**2*d
**2 - B*b**2*c*d**2 + b*c*d*(2*A*b*e - 2*A*c*d + B*b*d))/(-4*A*b*c**2*d*e + 4*A*c**3*d**2 + B*b**3*e**2 - 2*B*
b*c**2*d**2))/b**3 + (b*e - c*d)*(-2*A*c**2*d + B*b**2*e + B*b*c*d)*log(x + (-2*A*b**2*c*d*e + 2*A*b*c**2*d**2
 - B*b**2*c*d**2 + b*(b*e - c*d)*(-2*A*c**2*d + B*b**2*e + B*b*c*d)/c)/(-4*A*b*c**2*d*e + 4*A*c**3*d**2 + B*b*
*3*e**2 - 2*B*b*c**2*d**2))/(b**3*c**2)

________________________________________________________________________________________

Giac [A]
time = 1.07, size = 167, normalized size = 1.55 \begin {gather*} \frac {{\left (B b d^{2} - 2 \, A c d^{2} + 2 \, A b d e\right )} \log \left ({\left | x \right |}\right )}{b^{3}} - \frac {{\left (B b c^{2} d^{2} - 2 \, A c^{3} d^{2} + 2 \, A b c^{2} d e - B b^{3} e^{2}\right )} \log \left ({\left | c x + b \right |}\right )}{b^{3} c^{2}} - \frac {A b c^{2} d^{2} - {\left (B b c^{2} d^{2} - 2 \, A c^{3} d^{2} - 2 \, B b^{2} c d e + 2 \, A b c^{2} d e + B b^{3} e^{2} - A b^{2} c e^{2}\right )} x}{{\left (c x + b\right )} b^{2} c^{2} x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(e*x+d)^2/(c*x^2+b*x)^2,x, algorithm="giac")

[Out]

(B*b*d^2 - 2*A*c*d^2 + 2*A*b*d*e)*log(abs(x))/b^3 - (B*b*c^2*d^2 - 2*A*c^3*d^2 + 2*A*b*c^2*d*e - B*b^3*e^2)*lo
g(abs(c*x + b))/(b^3*c^2) - (A*b*c^2*d^2 - (B*b*c^2*d^2 - 2*A*c^3*d^2 - 2*B*b^2*c*d*e + 2*A*b*c^2*d*e + B*b^3*
e^2 - A*b^2*c*e^2)*x)/((c*x + b)*b^2*c^2*x)

________________________________________________________________________________________

Mupad [B]
time = 0.27, size = 154, normalized size = 1.43 \begin {gather*} \frac {\ln \left (x\right )\,\left (b\,\left (B\,d^2+2\,A\,e\,d\right )-2\,A\,c\,d^2\right )}{b^3}-\frac {\frac {A\,d^2}{b}+\frac {x\,\left (-B\,b^3\,e^2+2\,B\,b^2\,c\,d\,e+A\,b^2\,c\,e^2-B\,b\,c^2\,d^2-2\,A\,b\,c^2\,d\,e+2\,A\,c^3\,d^2\right )}{b^2\,c^2}}{c\,x^2+b\,x}+\frac {\ln \left (b+c\,x\right )\,\left (b\,e-c\,d\right )\,\left (B\,e\,b^2+B\,d\,b\,c-2\,A\,d\,c^2\right )}{b^3\,c^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((A + B*x)*(d + e*x)^2)/(b*x + c*x^2)^2,x)

[Out]

(log(x)*(b*(B*d^2 + 2*A*d*e) - 2*A*c*d^2))/b^3 - ((A*d^2)/b + (x*(2*A*c^3*d^2 - B*b^3*e^2 + A*b^2*c*e^2 - B*b*
c^2*d^2 - 2*A*b*c^2*d*e + 2*B*b^2*c*d*e))/(b^2*c^2))/(b*x + c*x^2) + (log(b + c*x)*(b*e - c*d)*(B*b^2*e - 2*A*
c^2*d + B*b*c*d))/(b^3*c^2)

________________________________________________________________________________________